﻿<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="net.zdsoft.keel.util.ServletUtils" %>
<%@page import="net.zdsoft.wpchat.support.util.PageUtils"%>
<%@page import="net.zdsoft.wpchat.support.action.frame.FrameAction"%>
<%@page import="java.util.List"%>
<%@page import="net.zdsoft.wpchat.support.entity.UserCatalog"%>
<%@page import="net.zdsoft.keel.util.ServletUtils"%>
<%@page import="net.zdsoft.wpchat.support.entity.AuthCatalog"%>
<%@page import="net.zdsoft.wpchat.support.entity.UserModule"%>
<%@page import="net.zdsoft.wpchat.support.entity.UserOperation"%>
<%
FrameAction mainMenuAction = (FrameAction) PageUtils.getAction();
List<UserCatalog> mainMenu = mainMenuAction.getMainMenu();
%>
<!doctype html>
<html>
<script type="text/javascript" src="<%=request.getContextPath() %>/script/prototype.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/script/buffalo.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/script/replyutils_s.js"></script>
<script type="text/javascript">
<!--
function doHeartbeat() {
  buffalo.remoteCall("remoteIndex.htm", "doHeartbeat", [], function(reply) {
  });
}
//-->
</script>
<head>
<meta charset="utf-8" />
<title>主菜单</title>
<style type="text/css">
body {
  margin: 0px;
  background-color: #eee;
}

#menu {
  padding: 10px 20px 10px 20px;
  background: #dfdfdf;
  color: #666;
  border: #fff 2px solid;
  width: 113px !important;
  width: 155px;
}

#menu ul {
  margin: 0px;
  padding: 0px;
  border: medium none;
  line-height: normal;
  list-style-type: none;
}

#menu li {
  margin: 0px;
}

#menu li a {
  padding: 5px 0px 5px 15px;
  border-top: #fff 1px solid;
  display: list-item;
  font-weight: bold;
  font-size: 12px;
  background: url("../../images/menu_dot.gif") transparent no-repeat 2px 8px;
  width: 100%;
  color: #444;
  text-decoration: none;
}

#menu li a:hover {
  background: url("../../images/menu_dot1.gif") #c61c18 no-repeat 2px 8px;
  color: #fff;
}

#message {
  font-weight: bold;
  font-size: 12px;
  text-align: center;
}
</style>
</head>
<body>
<div><a href="<%=ServletUtils.getWebsiteRoot(request)%>" target="_black"><img src="../../images/logo.gif" width="155" height="60" border="0" /></a></div>
<div id="menu"> 
  <ul><%
for (int i = 0; i < mainMenu.size(); i++) {
  UserCatalog userCatalog = (UserCatalog) mainMenu.get(i);
  AuthCatalog authCatalog = userCatalog.getCatalog();
  List<UserModule> userModuleList = userCatalog.getUserModuleList();

  StringBuffer description = new StringBuffer();
  for (int j = 0; j < userModuleList.size(); j++) {
    UserModule userModule = userModuleList.get(j);
    if (j > 0) {
      description.append("、");
    }
    description.append(userModule.getModule().getName());
  }

  UserModule firstModule = userCatalog.getFirstModule();
  UserOperation defaultOperation = firstModule.getDefaultUserOperation(); %>
    <li><a href="<%=PageUtils.getModuleTarget(defaultOperation)%>" target="mainFrame" title="<%=description%>"><%=authCatalog.getName()%></a></li><%
}%>
    <li><a href="../../logout.htm" target="_top">退出客服平台</a></li>
  </ul>
</div>
<div id="message"></div>
</body>
</html>
